package com.xwdeshj.controller;

import com.alibaba.fastjson.JSONObject;
import com.xwdeshj.service.XwFarmAtlasinfoService;
import com.xwdeshj.utils.IMoocExceptionHandler;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import javax.servlet.http.HttpServletRequest;

/**
 * Created by BKWJA on 2019/1/1.
 * 农家乐——农家图集信息 控制层
 */
@Slf4j
@Controller
@CrossOrigin(allowCredentials = "true")
@RequestMapping("farmAtlas")
public class XwFarmAtlasinfoController extends IMoocExceptionHandler {

    @Autowired
    private XwFarmAtlasinfoService xwFarmAtlasinfoService;

    /**
     * 新增农家乐图集
     * @param parmJson  farm_encryptId:农家乐加密id，imglink：图片链接url
     * @return
     */
    @RequestMapping("savefarmImgurl")
    @ResponseBody
    public JSONObject savefarmImgurl(String parmJson,HttpServletRequest request){
       return xwFarmAtlasinfoService.savefarmImgurl(parmJson,request);
    }

    /**
     *  弹框中获取对应店铺下的 图片图集
     * @param farm_encryptId
     * @param request
     * @return
     */
    @RequestMapping("getfarmaltlasinfowin")
    @ResponseBody
    public JSONObject getfarmaltlasinfowin(String farm_encryptId,HttpServletRequest request){
        return xwFarmAtlasinfoService.getfarmaltlasinfowin(farm_encryptId,request);
    }





}
